package net.stogi.dsper.ui.client.module.datasource;

import com.google.gwt.event.shared.GwtEvent;

public class DataSourceEditorClosedEvent extends GwtEvent<DataSourceEditorClosedHandler> {

	public static final GwtEvent.Type<DataSourceEditorClosedHandler> TYPE = new GwtEvent.Type<DataSourceEditorClosedHandler>();

	private boolean persisted;

	public DataSourceEditorClosedEvent(boolean persisted) {
		this.persisted = persisted;
	}

	@SuppressWarnings("unused")
	private DataSourceEditorClosedEvent() {}

	@Override
	public Type<DataSourceEditorClosedHandler> getAssociatedType() {
		return TYPE;
	}

	/**
	 * @return the persisted
	 */
	public boolean isPersisted() {
		return persisted;
	}

	/**
	 * @param persisted
	 *            the persisted to set
	 */
	public void setPersisted(boolean persisted) {
		this.persisted = persisted;
	}

	@Override
	protected void dispatch(DataSourceEditorClosedHandler handler) {
		handler.onDataSourceEditorClosed(this);
	}
}
